CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

PROJECT(chapter2)

CreateLibrary()

FILE(GLOB RUNNERSOURCES "${CMAKE_CURRENT_SOURCE_DIR}/runners/*.cpp")

FOREACH(RUNNERSOURCE ${RUNNERSOURCES})

	CreateExecutable(${RUNNERSOURCE} chapter2 TKernel TKMath TKSTL TKBO TKPrim TKSTEP)

ENDFOREACH(RUNNERSOURCE)

SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/testrunners")
FILE(GLOB TESTSOURCES "${CMAKE_CURRENT_SOURCE_DIR}/tests/*.cpp")
ADD_EXECUTABLE(chapter2_test ${TESTSOURCES})
TARGET_LINK_LIBRARIES(chapter2_test chapter2 TKernel TKMath)
ADD_TEST(chapter2_tests "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/chapter2_test")
